import time,asyncio

def two():
    start=time.time()
    async def do_some_work():
        print('Start coroutine')
        time.sleep(0.1)
        print('This is a coroutine')
    loop=asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    coroutine=do_some_work()
    task=loop.create_task(coroutine)
    print('Is task an object of asyncio.Task ? ',isinstance(task,asyncio.Task))
    print('Task state: ',task._state)
    loop.run_until_complete(task)
    print('Task state: ',task._state)
    end=time.time()
    print('Running time:{:.4f}'.format(end-start))

two()
